import "../node_modules/.pnpm/element-plus@2.3.12_vue@3.3.4/node_modules/element-plus/theme-chalk/base.css.js";
import "../node_modules/.pnpm/element-plus@2.3.12_vue@3.3.4/node_modules/element-plus/theme-chalk/el-carousel.css.js";
import "../node_modules/.pnpm/element-plus@2.3.12_vue@3.3.4/node_modules/element-plus/theme-chalk/el-carousel-item.css.js";
import { defineComponent as u, onMounted as g, openBlock as t, createElementBlock as o, createVNode as _, withCtx as a, Fragment as h, renderList as p, createBlock as f, createCommentVNode as v, pushScopeId as k, popScopeId as y, createElementVNode as l } from "vue";
import { ElCarouselItem as C, ElCarousel as E } from "../node_modules/.pnpm/element-plus@2.3.12_vue@3.3.4/node_modules/element-plus/es/components/carousel/index.js";
const r = (e) => (k("data-v-c2f544c6"), e = e(), y(), e), I = { class: "background-container" }, b = {
  key: 0,
  class: "background-img"
}, B = /* @__PURE__ */ r(() => /* @__PURE__ */ l("div", { class: "img" }, null, -1)), N = [
  B
], S = {
  key: 1,
  class: "carousel"
}, x = /* @__PURE__ */ r(() => /* @__PURE__ */ l("div", { class: "img" }, null, -1)), L = /* @__PURE__ */ u({
  __name: "Background",
  props: {
    // 背景需要展示的图片
    images: { type: Array, default: [] },
    // 背景图片有多张时，每个背景图片轮播的事件间隔，单位“毫秒”
    interval: { type: Number, default: 5e3 }
  },
  setup(e) {
    const s = e;
    return g(() => {
      document.querySelectorAll(".img").forEach((n, c) => {
        n.style.backgroundImage = `url(${s.images[c]})`;
      });
    }), (i, n) => {
      const c = C, m = E;
      return t(), o("div", I, [
        e.images.length == 1 ? (t(), o("div", b, N)) : e.images.length > 1 ? (t(), o("div", S, [
          _(m, {
            height: "100vh",
            interval: e.interval
          }, {
            default: a(() => [
              (t(!0), o(h, null, p(e.images.length, (d) => (t(), f(c, { key: d }, {
                default: a(() => [
                  x
                ]),
                _: 2
              }, 1024))), 128))
            ]),
            _: 1
          }, 8, ["interval"])
        ])) : v("", !0)
      ]);
    };
  }
});
export {
  L as default
};
